package com.lzs.bootsafety.common.framework;

import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import java.util.List;

/**
 * @author  zhanshi Liu
 * @date    2020/05/13
 * @website www.jhmsona.cn
 */

public class VerifyResult {
    public static String  validateResult(BindingResult bindingResult){
        List<ObjectError> allErrors = bindingResult.getAllErrors();
        return allErrors.get(0).getDefaultMessage();
    }
}
